n, m = list(map(int, input().split()))
List = list(map(int, input().split()))
j = 0
count = 0
total = 0
for i in range(j, n):
    total += List[i]
    if total <= m:
        continue
    else:
        count += 1
        total = List[i]
print(count + 1)
